# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VMwareEngine.V1.Model.Subnet do
  @moduledoc """
  Subnet in a private cloud. Either `management` subnets (such as vMotion) that are read-only, or `userDefined`, which can also be updated.

  ## Attributes

  *   `gatewayIp` (*type:* `String.t`, *default:* `nil`) - The IP address of the gateway of this subnet. Must fall within the IP prefix defined above.
  *   `ipCidrRange` (*type:* `String.t`, *default:* `nil`) - The IP address range of the subnet in CIDR format '10.0.0.0/24'.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name of this subnet. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet`
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The state of the resource.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Output only. The type of the subnet. For example "management" or "userDefined".
  *   `vlanId` (*type:* `integer()`, *default:* `nil`) - Output only. VLAN ID of the VLAN on which the subnet is configured
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :gatewayIp => String.t() | nil,
          :ipCidrRange => String.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :type => String.t() | nil,
          :vlanId => integer() | nil
        }

  field(:gatewayIp)
  field(:ipCidrRange)
  field(:name)
  field(:state)
  field(:type)
  field(:vlanId)
end

defimpl Poison.Decoder, for: GoogleApi.VMwareEngine.V1.Model.Subnet do
  def decode(value, options) do
    GoogleApi.VMwareEngine.V1.Model.Subnet.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VMwareEngine.V1.Model.Subnet do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
